package com.spatio.serving.basic.service.template.mysql.mapper;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import com.spatio.serving.basic.service.template.common.domain.HistoryCaloriesDo;
import com.spatio.serving.basic.service.template.common.domain.MealDo;
import com.spatio.serving.basic.service.template.common.domain.MealStaticsDo;
import com.spatio.serving.basic.service.template.common.domain.mutliFoodRecordDo;
import com.spatio.serving.basic.service.template.common.dto.dify.DifyCommon;
import org.apache.ibatis.annotations.Param;

import java.math.BigInteger;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

public interface MealMapper extends BaseMapper<MealDo> {

    boolean update_meal(MealDo mealdo);

    List<MealDo> queryBydate(@Param("userId") Integer userId, @Param("date") LocalDate time);

    MealStaticsDo queryToday(@Param("userId")BigInteger userId, @Param("date") LocalDate time);



    boolean food_record(@Param("userId")BigInteger useId,
                        @Param("time")LocalDateTime time,@Param("messageId")String messageId,
                        @Param("conversationId")String conversationId, @Param("mutli")Object mutli);

    JSONArray queryFoodLog(@Param("userId")BigInteger useId,@Param("messageId")String messageId);

    boolean saveImage(@Param("userId")BigInteger userId, @Param("conversationId")String newDifyConversationId, @Param("url")String url);

    List<String> queryUrlLog(@Param("userId")BigInteger userId, @Param("conversationId")String conversationId);

    boolean changeFood(@Param("userId")BigInteger userId, @Param("food") Object food);

    boolean deleteFood(@Param("userId")BigInteger userId, @Param("uuid")String uuid);

    List<mutliFoodRecordDo> findHistory(@Param("userId")BigInteger userId, @Param("time")LocalDate time);

    List<mutliFoodRecordDo> queryByKind(@Param("userId")BigInteger userId, @Param("time")LocalDate time, @Param("kind")String kind);

    boolean completeRecord(@Param("userId")BigInteger userId,@Param("food")Object food);

    List<mutliFoodRecordDo> queryBystates(@Param("userId")BigInteger userId, @Param("state")int state, @Param("time")LocalDate time);

    String queryUserDocId(@Param("userId")BigInteger userId);


    List<mutliFoodRecordDo> getRecordForDoc(BigInteger userId);

    boolean changState(@Param("userId")BigInteger userId, @Param("uuid")String uuid);

}
